package cn.wolfcode.mq;

import cn.wolfcode.common.constants.CommonConstants;
import cn.wolfcode.service.ISeckillProductService;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

@Component
@RocketMQMessageListener(consumerGroup = "OrderPayTimeConsumer",topic = MQConstant.ORDER_PAY_TIMEOUT_TOPIC)
public class OrderPayTimeQueueListener implements RocketMQListener<OrderMQResult> {
    @Resource
    private ISeckillProductService seckillProductService;
    @Override
    public void onMessage(OrderMQResult orderMQResult) {
        //取消订单
        seckillProductService.findProductByNo(orderMQResult.getOrderNo());
    }
}
